// miniprogram/pages/my/record/record.js

const db = wx.cloud.database();

Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.cloud.callFunction({
      name: "login"
    }).then(res => {
      this.setData({
        openid: res.result.openid
      })
      db.collection('user').where({
          "openid": this.data.openid
        }).get()
        .then(ers => {
          this.setData({
            user: ers.data
          })
          console.log(this.data.user);
        })

    })
  },

  showInput: function () {
    this.setData({
      inputShowed: true
    });
  },
  hideInput: function () {
    this.setData({
      inputVal: "",
      inputShowed: false
    });
  }



})